<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page errorPage="error.jsp" %>

<c:set var="userNotpayedRequests"
		value="${sessionScope.carRentAppModel.getAllUserNotPayedCarRequests()}" />

<html>
<head>
<title>Car Rent 1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<style type="text/css">
body,table,hr {
	color: black;
	background: silver;
	font-family: Verdana, sans-serif;
	font-size: x-small;
}
</style>
</head>

<body>
	<h2>Car Rent 1.0</h2>
	<a href="defaultAction.perform">Go to Start</a>
	<fieldset>
		<legend>
			<b>Bills To Pay</b>
		</legend>
		<table border="below" cellpadding="10" cellspacing="0" width="100%">
			<tr>
				<th align="center">Name</th>
				<th align="center">Car</th>
				<th align="center">Rent duration</th>
				<th align="center">Bill purpose</th>
				<th align="center">Action</th>
			</tr>
			<c:forEach items="${userNotpayedRequests}" var="userNotpayedRequest">
				<c:set var="car" value="${userNotpayedRequest.getCar()}" />
				<c:set var="user" value="${userNotpayedRequest.getUser()}" />
				<tr>
					<td align="center"><c:out
							value="${userNotpayedRequest.getName()}" /></td>
					<td align="center"><c:out
							value="${car.getManufacturer()} ${car.getModel()} ${car.getNumber()}" /></td>
					<td align="center"><c:out
							value="${userNotpayedRequest.getRentDuration()}" /></td>
					<td align="center"><c:out
							value="${userNotpayedRequest.getBillPurpose()}" /></td>
					<td align="center">
						<form method="post" action="payRequestAction.perform">
							<input type="hidden" name="id"
								value="${userNotpayedRequest.getID()}"> <input
								type="submit" name="pay" value="pay">
						</form>
				</tr>
			</c:forEach>
		</table>

	</fieldset>
</body>

</html>